ParcelTrack API
Subscription DELETE
Resource URL
UAT:
https://api.uat.nzpost.co.nz/parceltrack/3.0/subscription/webhook/{subscription_id}
Production:
https://api.nzpost.co.nz/parceltrack/3.0/subscription/webhook/{subscription_id}
Resource Description
Marks an existing subscription as inactive.
Resource Information
Attribute | Detail |
---|---|
Response Format | JSON |
Requires Authentication | Yes |
Rate Limited | 15 calls per second across all merchants using the API. If rate limit is exceeded, calls will be queued. Calls unprocessed for over 60 seconds will time out. |
Request Parameters
Field Name | Description | Mand | Example |
---|---|---|---|
subscription_guid | Unique identifier for a subscription record | Yes | 32ffd9bd-8ea5-4167-85d8-a20d4a5e7a31 |
Sample Request
https://api.nzpost.co.nz/parceltrack/3.0/subscription/webhook/32ffd9bd-8ea5-4167-85d8-a20d4a5e7a31
Response Parameters
The following lists the required fields in the /labels/domestic response message.
Field Name | Description | Mand | Example |
---|---|---|---|
success | Returns true if request is successful else false | Yes | True |
message_id | A unique identifier for the API Call | Yes | 0d41ffa0-0976-11e5-8fa8-02850e3bb9fb |
errors | If the subscription creation is unsuccessful, an error code and message is provided | Yes if API call is unsuccessful | See section Error Object Parameters |
Error Response Elements
Field Name | Description | Mand | Example |
---|---|---|---|
success | Returns if request is successful | Yes | True |
errors | Error object with error details | Y if success =false | See Error Object Parameters below |
message_id | The unique message identifier | Yes | ec608f40-2a8b-11e5-a9c0-025c481d35ef |
Error Object Parameters
Field Name | Description | Example |
---|---|---|
code | Error code where first 3 digits are http status code, last three digits identify error type | 400002 |
message | Description of error code | Invalid Parameter(s) |
details | Description of specific error | Subscription_guid not found |
HTTP Status Codes
Note that some error messages are customised for the request, i.e. error code 400 usually will describe what is wrong with the request
Code | Message |
---|---|
200 | Success |
400 | Bad request |
401 | Unautorized |
403 | Forbidden |
409 | Invalid request |
500 | System unavailable |
Sample Response
Sample: Success
{
"success": true,
"message_id": "28eed9bd-8ea5-4167-85d8-a20d4a5e7a42"
}
Sample: Failure
{
"success": false,
"errors": [ {
"code": "400002",
"message": "Invalid parameter(s)",
"details": "Subscription_guid not found"
}],
"message_id": "28eed9bd-8ea5-4167-85d8-a20d4a5e7a42"
}